﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ESAM_Assignment_3
{
    public partial class DeleteComment : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int CommentID = Convert.ToInt32(Request.QueryString["CommentID"]);
                lblCommentID.Text = CommentID.ToString();

                bool status  = CommentClass.DeleteComment(CommentID);

                if (status)
                {
                    lblStatus.ForeColor = System.Drawing.Color.Blue; 
                    lblStatus.Text = "Success. Comment has been deleted.";

                }
                else
                {
                    lblStatus.ForeColor = System.Drawing.Color.Red;
                    lblStatus.Text = "Error! Comment has been deleted.";
                }
            }
        }
    }
}